package com.onepiece.shipelves.common.ticker;

import org.springframework.util.Assert;

/**
 * Created by guoyanjiang on 2019-04-10.
 */
public class FutureTickerPair extends BaseTickerPair {

    private String future;

    public FutureTickerPair(String pair) {
        super(pair);
        String[] splits = pair.split("_");
        Assert.isTrue(splits.length > 2, "错误的交易对");
        this.future = splits[2];
    }

    public FutureTickerPair(String symbol, String currencyUnit, String future) {
        super(symbol, currencyUnit);
        this.future = future;
    }

    public String getFuture() {
        return future;
    }

    @Override
    public String providePairStr() {
        return String.format("%s_%s", super.providePairStr(), future);
    }
}
